package com.peng.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.peng.mapper.WelfareMapper;
import com.peng.pojo.WelfareCastle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WelfareServiceImp implements WelfareService {
    @Autowired
    private WelfareMapper welfareMapper;

    @Override
    public PageInfo<WelfareCastle> selectAllWelfareCastle(String name, Integer teacherId, Integer typeId, int page, int size) {
        PageHelper.startPage(page, size);
        return new PageInfo<>(welfareMapper.selectAllWelfareCastle(name, teacherId, typeId));
    }

    @Override
    public boolean updateWelfareCastleStatus(int status, Integer... id) {
        if (id != null) {
            welfareMapper.updateWelfareCastleStatus(status, id);
        }
        return true;
    }
}
